package com.lanou.managerLogin.category.web.servlet;

import com.lanou.managerLogin.category.service.CategoryService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/insertCategoryServletTwo")
public class InsertCategoryServletTwo extends HttpServlet {

    private CategoryService cs = new CategoryService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String cname = req.getParameter("cname");
        cs.insertCategory(cname);
        req.getRequestDispatcher("/adminjsps/admin/category/list.jsp").forward(req, resp);

    }
}
